/*
 * @Author: wangyongcun
 * @Date: 2021-08-14 01:52:05
 * @LastEditors: wangyongcun
 * @LastEditTime: 2021-08-14 21:10:52
 * @Description: 导出src\routes下所有的路由
 */
import { createRouter, createWebHistory } from "vue-router";
const paths = import.meta.globEager('../routes/*.ts');

const routes = Object.keys(paths).reduce((all, path) => {
    return all.concat(paths[path].default);
}, []);

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes,
})

export default router;